import random

# 为变量设置类型注解
var_1: int = 10
var_2: float = 3.1251
var_3: bool = True


# 类对象类型注解
class Student:
    pass


stu: Student = Student()

# 基础容器类型注解
my_list: list = [1, 23, 4]
my_tuple: tuple = (1, 23, 4)
my_set: set = {12, 2, 4}
my_dict: dict = {"name": "张三"}
my_str: str = "测试"

# 容器类型详细注解
my_list: list[int] = [1, 23, 4]
my_tuple: tuple[int, str, boole] = (1, "23", False)
my_set: set[int] = {12, 2, 4}
my_dict: dict[str, int] = {"name": "张三"}
my_str: str = "测试"


# 使用注释进行类型声明
# 使用type：参数
def func():
    return 10


var_3 = func()  # type:int


# 函数或者方法的类型注解-形参注解

def test(data: int):
    return data * 10


# 对方法返回值设置返回值注解
# 使用"->" 
def test1(data: int) -> int:
    return data * 10


# 查看函数类型快捷键  crtl+p
func1()
test()
